using CLELCore;
using System.Collections.Generic;

namespace CLELCore.Executable
{
	public class DataDirectories
	{
		public const int EXPORTTABLE_INDEX = 0;
		public const int IMPORTTABLE_INDEX = 1;
		public const int RESOURCETABLE_INDEX = 2;
		public const int EXCEPTIONTABLE_INDEX = 3;
		public const int CERTIFICATETABLE_INDEX = 4;
		public const int BASERELOCATIONTABLE_INDEX = 5;
		public const int DEBUG_INDEX = 6;
		public const int COPYRIGHT_INDEX = 7;
		public const int GLOBALPTR_INDEX = 8;
		public const int TLSTABLE_INDEX = 9;
		public const int LOADCONFIGTABLE_INDEX = 10;
		public const int BOUNDIMPORT_INDEX = 11;
		public const int IMPORTADDRESSTABLE_INDEX = 12;
		public const int DELAYIMPORTDESCRIPTOR_INDEX = 13;
		public const int CLIHEADER_INDEX = 14;
		public const int RESERVED_INDEX = 15;

		private List<DataDirectory> _datadirectories;

		public DataDirectories()
		{
			_datadirectories = new List<DataDirectory>();
		}

		public int Count
		{
			get
			{
				return _datadirectories.Count;
			}
		}

		public DataDirectory this[int index]
		{
			get
			{
				if(index < 0 && index >= _datadirectories.Count)
					return null;
				return _datadirectories[index];
			}
			set
			{
				if(index >= 0 && index < _datadirectories.Count)
					_datadirectories[index] = value;
			}
		}

		public void Add(DataDirectory datadirectory)
		{
			_datadirectories.Add(datadirectory);
		}
	}
}
